package com.program.facesigninsystem.test;

import com.program.facesigninsystem.FaceSignInSystemApplication;
import com.program.facesigninsystem.service.ISignInActivityService;
import com.program.facesigninsystem.util.GetInfoUtil;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.TestOnly;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = FaceSignInSystemApplication.class)
public class test {
    private RedisTemplate<String, String> redisTemplate;

    @Test
    public void testConnection() {
        try {
            ValueOperations<String, String> valueOps = redisTemplate.opsForValue();
            valueOps.set("testKey", "testValue");
            String value = valueOps.get("testKey");
            System.out.println("Redis connection is working: " + value);
        } catch (Exception e) {
            System.err.println("Error connecting to Redis: " + e.getMessage());
        }
    }
}
